<template>
	<view>
		<view class="goods" >
			<view class="good" v-for="g in list" :key="g.id" @click="turnto(g.id)">
				<image :src="g.img_url"></image>
				<text class="nprice" >￥{{g.sell_price}}</text>
				<text class="oprice">￥{{g.market_price}}</text>
				<view class="name">
					{{g.title}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"goodsList",
		data() {
			return {
			};
		},
		props:['list'],
		methods:{
			turnto(id){
				this.$emit('navto',id)
			}
		}
		
		
	}
</script>

<style scoped lang="scss">
.goods{
				padding: 0 15rpx;
				display: flex;
				flex-wrap: wrap;
				justify-content: space-between;
				.good{
					background: #fff;
					margin:10rpx 0;
					width: 355rpx;
					padding: 15rpx;
					box-sizing: border-box;
					image{
						width: 80%;
						height: 150px;
						display: block;
						margin: 0 auto;
					}
					.nprice{
						color: $index_color;
						font-size: 36rpx
					}
					.oprice{
						color: #ccc;
						font-size: 28rpx;
						margin-left: 17rpx;
						text-decoration: line-through;
					}
					.name{
						font-size: 30rpx;
						line-height: 40rpx;
						padding-bottom: 10rpx;
						padding-top: 8rpx;
					}
				}
			}
</style>